import java.util.*;
import java.awt.*;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.net.MalformedURLException;
import org.rsbot.script.Script;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.methods.Mouse;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.methods.Camera;
import org.rsbot.script.wrappers.RSTile;
import org.rsbot.script.wrappers.RSArea;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.methods.Calculations;
import org.rsbot.script.methods.Game;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.event.events.ServerMessageEvent;
import org.rsbot.event.listeners.ServerMessageListener;
import org.rsbot.script.util.Filter;
import org.rsbot.script.methods.Menu;

@ScriptManifest(authors = "Brianpsv1", keywords = "Mining", name = "WorldMinerProTweaked", version = 3.0, description = "Multiple Location Miner including Ming Guild ~ Edited By SK Added more options, Places, & Priortized Mithril @ Ming Guild :)")
public class WorldMinerPro extends Script implements PaintListener, ServerMessageListener{
    private minegui minegui;
    /**
	 * Tiles
	*/
	public RSTile[] toBank;
	public RSTile[] toMine;
	public RSTile BankTile;
	public RSTile MineTile;
	public RSTile FixGate = new RSTile(3045, 9742);
	public RSArea guildarea = new RSArea(new RSTile(3055, 9757), new RSTile(3026, 9732));
	/**
	 * Objects
	 */
	 public RSObject Rock;
    /**
     * Integers
     */
	int AntiBan;
    int SleepTime;
	int MouseSpeed;
	int[] Rocks;
	int OreMined;
	int GemsMined;
	int profit;
	int coalprice;
	int copperprice;
	int silverprice;
	int ironprice;
	int clayprice;
	int tinprice;
	int startexp;
	int xpGained;
	int startlvl;
	int pickID[] = {1265, 1269, 1267, 1273, 1271, 1275, 15259, 15261};
	int[] goladdup = {6226};
	int[] goladdown = {2113};
	int[] thebankid = {11402, 11758, 11402, 2213, 35647};
	int[] cross = { 14504 };
	
    /**
     * Strings
     */
    

    /**
     * Booleans
     */
    boolean PowerMine;
	boolean Start = false;
	boolean Settings = false;
	boolean MineGuild = false;
	boolean HidePaint = false;
	boolean wildi = false;
	boolean paint = true;
	boolean rest = false;
	/**
	 * Others
	 */
	BufferedImage normal = null;    
	BufferedImage clicked = null;
	BufferedImage cape = null;
	long startTime = System.currentTimeMillis();
    public boolean onStart() {
        log("Welcome to Brian's WorldMinerPro 2");
		minegui = new minegui();
        minegui.setVisible(true);
		startlvl = skills.getCurrentLevel(Skills.MINING);
		startexp = skills.getCurrentExp(Skills.MINING);
		try {
			final URL capeURL = new URL(
                    "http://i54.tinypic.com/658nld.png");
            final URL cursorURL = new URL(
                    "http://i53.tinypic.com/a4050y.png");
            final URL cursor80URL = new URL(
                    "http://i53.tinypic.com/149mmva.png");
			cape = ImageIO.read(capeURL);
            normal = ImageIO.read(cursorURL);
            clicked = ImageIO.read(cursor80URL);
        } catch (MalformedURLException e) {
            log("Unable to buffer cursor.");
        } catch (IOException e) {
            log("Unable to open cursor image.");
        }
		coalprice = grandExchange.getMarketPrice(453);
		copperprice = grandExchange.getMarketPrice(436);
		ironprice = grandExchange.getMarketPrice(440);
		tinprice = grandExchange.getMarketPrice(438);
		silverprice = grandExchange.getMarketPrice(442);
		clayprice = grandExchange.getMarketPrice(434);
        return true;
    }
	public void serverMessageRecieved(ServerMessageEvent e) {
        String svrmsg = e.getMessage();
        if (svrmsg.contains("iron")) {
            OreMined = OreMined + 1;
            profit = ironprice * OreMined;
        }
        if (svrmsg.contains("tin")) {
            OreMined = OreMined + 1;
			profit = tinprice * OreMined;
        }
        if (svrmsg.contains("copper")) {
            OreMined = OreMined + 1;
			profit = copperprice * OreMined;
        }
        if (svrmsg.contains("coal")) {
            OreMined = OreMined + 1;
            profit = coalprice * OreMined;
        }
        if (svrmsg.contains("silver")) {
            OreMined = OreMined + 1;
			profit = silverprice * OreMined;
        }
        if (svrmsg.contains("gold")) {
            OreMined = OreMined + 1;
        }
        if (svrmsg.contains("clay")) {
		    profit = clayprice * OreMined;
            OreMined = OreMined + 1;
        }
        if (svrmsg.contains("just found")) {
            GemsMined = GemsMined + 1;
        }
}
    
    public int loop() {
        if(Start) {
		if(Settings) {
		mouse.setSpeed(MouseSpeed);
		camera.setPitch(random(90, 100));
		Settings = false;
		}
		if ( walking.getEnergy() > random(60,100)) {
		walking.setRun(true);
		}
		if(rest) {
		if ( walking.getEnergy() < 2) {
		walking.rest();
		}
		}
		DoAntiBan();
		if(inventory.isFull()) {
			if(PowerMine) {
			DropOre();	
			} else if(!PowerMine) {
			Bank();
			}
		} else if(!inventory.isFull()) {
		Mine();
		}
		}
        return 10;

    }
	public boolean DropOre() {
		while (inventory.getCount() > 1) {
		inventory.dropAllExcept(pickID);
		}
		return true;
	}
	public void DoAntiBan() {
	AntiBan = AntiBan + 1;
		if(AntiBan == 400) {
		sleep(random(200, 300));
		int randomizer = random(1, 5);
		if(randomizer == 2) {
		camera.setAngle(random(0, 180));
		camera.setPitch(random(80, 100));
		}
		if(randomizer == 3) {
			if(getMyPlayer().getAnimation() == 624) {
		game.openTab(Game.TAB_STATS);
		mouse.move(704 + random(-30, 29), 223 + random(-13, 13));
		sleep(random(500, 1250));
		game.openTab(Game.TAB_INVENTORY);
			}
		}
		if(randomizer == 4) {
			if(getMyPlayer().getAnimation() == 624) {
		game.openTab(Game.TAB_FRIENDS);
		sleep(random(500, 1250));
		game.openTab(Game.TAB_INVENTORY);
			}
		}
		AntiBan = 0; 
		}
	}
	public void Mine() {
	SleepTime = 1;
	RSObject ore = objects.getNearest(Rocks);
	if (ore != null) {
		if(calc.distanceTo(ore) < 6) {
			if(getMyPlayer().getAnimation() == 624) {
			// Already mining
				if(!onHorizontalOrVertTile(ore.getLocation())) {
				// Death Rock
					if(ore.isOnScreen()) {
						if(MineGuild) { 
						if ( guildarea.contains(ore.getLocation())) {
						
						} else {
						walking.walkTo(FixGate);
						sleep(1500);
						return;
						}
						}
					ore.doAction("Mine");
					SleepTime = 1000;
					
					
					
					} else {
					if(MineGuild) { 
						if ( guildarea.contains(ore.getLocation())) {
						
						} else {
						walking.walkTo(FixGate);
						sleep(1500);
						return;
						}
						}
					camera.turnToObject(ore);
					ore.doAction("Mine");					
					SleepTime = 1000;
					}
				}
				if(menu.contains("Mine")) {
				} else {
				RSObject NextOre = getSecondNearest( ore, Rocks );
					if(NextOre != null) {
						if(NextOre.isOnScreen()) {
						mouse.move( calc.tileToScreen(NextOre.getLocation()), 13, 13 ); 
						} else {
						camera.turnToObject(NextOre);
						mouse.move( calc.tileToScreen(NextOre.getLocation()), 13, 13 ); 
						}
						}
						}
			}
			if(getMyPlayer().getAnimation() == -1) {
				if(ore.isOnScreen()) {
					if(getMyPlayer().isMoving()) {
					} else {		
						if(MineGuild) { 
						if ( guildarea.contains(ore.getLocation())) {
						
						} else {
						walking.walkTo(FixGate);
						sleep(1500);
						return;
						}
						}
					ore.doAction("Mine");
					SleepTime = 1000;
					}
				} else {
					if(getMyPlayer().isMoving()) {
					} else {
					if(MineGuild) { 
						if ( guildarea.contains(ore.getLocation())) {
						
						} else {
						walking.walkTo(FixGate);
						sleep(1500);
						return;
						}
						}
				camera.turnToObject(ore);				
				ore.doAction("Mine");
				SleepTime = 1000;
					}
				}
			
			}
		} else {
		if(MineGuild) { 
			if ( guildarea.contains(ore.getLocation())) {
						
			} else {
			walking.walkTo(FixGate);
			sleep(1500);
			return;
			}
			}
		walking.walkTo(ore.getLocation());
		SleepTime = 1500;
		}
	} else {
		if(MineGuild) {
		RSObject LadderDown = objects.getNearest(goladdown);
			if(LadderDown != null) {
				if(calc.distanceTo(LadderDown) < 4) {
				camera.turnToObject(LadderDown);
				LadderDown.doAction("Climb-down");
				SleepTime = 2000;
				} else {
				walking.walkPathMM(toMine, 2 ,2);
				SleepTime = 1500;
				}
			} else {
			walking.walkPathMM(toMine, 2 ,2);
			}
		} else {
		if(calc.distanceTo(MineTile) < 7) {
		} else {
		walking.walkPathMM(toMine, 2 ,2);
		}
		}
	SleepTime = 1500;
	}
	sleep(SleepTime);
	}
	public void Bank() {
	SleepTime = 1;
	RSObject BankBooth = objects.getNearest(thebankid);
	if(calc.distanceTo(BankTile) < 5) {
	if (!bank.isOpen()) {
	BankBooth.doAction("Use-quickly");
	SleepTime = 2000;
	}
	if (bank.isOpen()) {
	bank.depositAllExcept(pickID);
	bank.close();
	SleepTime = 1500;
	}
	} else {
	SleepTime = 2000;
	if(MineGuild) {
	RSObject LadderUp = objects.getNearest(goladdup);
		if(LadderUp != null) {
			if(calc.distanceTo(LadderUp) < 4) {
			camera.turnToObject(LadderUp);
			LadderUp.doAction("Climb-up");
			SleepTime = 2000;
			} else {
			walking.walkPathMM(toBank, 2,2);
			}
		} else {
		walking.walkPathMM(toBank, 2 ,2);
		}
	} else {
	walking.walkPathMM(toBank, 2 ,2);
	}
	}
	sleep(SleepTime);
	}
	public void AntiBan() {
	
	}	

    public void onRepaint(Graphics g) {
			if(Start) {
			if(paint) {
		int lvlGain = skills.getCurrentLevel(Skills.MINING) - startlvl;
        xpGained = skills.getCurrentExp(Skills.MINING) - startexp;
		long millis = System.currentTimeMillis() - startTime;
		int xpPerHour = (int) (3600000.0 / millis * xpGained);
		int orePerHour = (int) (3600000.0 / millis * OreMined);
		long hours = millis / (1000 * 60 * 60);
        millis -= hours * (1000 * 60 * 60);
        long minutes = millis / (1000 * 60);
        millis -= minutes * (1000 * 60);
        long seconds = millis / 1000;
        long minutes2 = minutes + (hours * 60);
		int TTL = skills.getExpToNextLevel(Skills.MINING)/ xpPerHour;
		int XPtoLvl = skills.getExpToNextLevel(Skills.MINING);
		int T99 = 13034431/ xpPerHour;
		int percent = skills.getPercentToNextLevel(Skills.MINING);
		if (normal != null) {
            /*
             * Mouse Paint By RsTra
             * This is for RSBot 2.0+!
             */
            final int mouse_x = mouse.getLocation().x;
            final int mouse_y = mouse.getLocation().y;
            final int mouse_x2 = mouse.getPressLocation().x;
            final int mouse_y2 = mouse.getPressLocation().y;
            final long mpt = System.currentTimeMillis()
                    - mouse.getPressTime();
            if (mouse.getPressTime() == -1 || mpt >= 1000) {
                g.drawImage(normal, mouse_x - 8, mouse_y - 8, null); //this show the mouse when its not clicked
            }
            if (mpt < 1000) {
                g.drawImage(clicked, mouse_x2 - 8, mouse_y2 - 8, null); //this show the four squares where you clicked.
                g.drawImage(normal, mouse_x - 8, mouse_y - 8, null); //this show the mouse as normal when its/just clicked
				
            }
        }
		
		Rectangle r = new Rectangle(496, 345, 15, 14);
		if(r.contains(mouse.getLocation())) {
		HidePaint = true;		
		} else {
		HidePaint = false;
		}
		// End Mouse
		if(HidePaint == true) {
		g.setColor(new Color(255, 0, 0, 250));
		g.fillRect(496, 345, 15, 14);
		}
		// Screen Paint
		if(HidePaint == false) {
		g.setColor(new Color(0, 0, 0, 203));
		g.fillRect(7, 345, 505, 128);
		g.setColor(new Color(255, 0, 0, 250));
		g.fillRect(496, 345, 15, 14);
		g.setColor(new Color(0, 0, 0));
		g.drawLine(510, 345, 496, 359);
		g.setColor(new Color(0, 0, 0));
		g.drawLine(510, 359, 496, 345);
		g.setFont(new Font("Comic Sans MS", 0, 16));
		g.setColor(new Color(255, 0, 0));
		g.drawString("Brian's World Miner Pro", 16, 360);
		g.setFont(new Font("Century Schoolbook", 0, 12));
		g.setColor(new Color(255, 0, 0));
		g.drawString("Runtime: "  + hours + ":" + minutes + ":" + seconds , 16, 375);
		g.setFont(new Font("Century Schoolbook", 0, 12));
		g.setColor(new Color(255, 0, 0));
		g.drawString("Exp/H: " + xpPerHour, 16, 389);
		g.setFont(new Font("Century Schoolbook", 0, 12));
		g.setColor(new Color(255, 0, 0));
		g.drawString("Ores Mined: " + OreMined, 16, 403);
		g.drawString("Gems Mined: " + GemsMined, 16, 417);
		g.drawString("TTL: " + TTL + " Hours", 16, 431);
		g.drawString("Exp TL: " + XPtoLvl, 16, 445);
		g.drawString("Time T99: " + T99 + " Hours", 16, 459);
		g.drawString(percent + "% to next level", 156, 375);
		g.drawString("Exp: " + skills.getCurrentExp(Skills.MINING), 156, 389);
		g.drawString("Profit: " + profit + "gp", 156, 403);
		g.drawString("Levels Gained: " + lvlGain, 156, 417);
		g.drawString("Ores/H: " + orePerHour, 156, 431);
		g.drawString("Exp Gained: " + xpGained, 156, 445);
		g.drawString("Level: " + skills.getCurrentLevel(Skills.MINING), 156, 459);
		// Cape Image 
		g.drawImage(cape, 441, 339, null); 
		}
		if(Start) {
		drawModel(g, objects.getNearest(Rocks), Color.RED, "", Color.BLACK);
		}
		}
		}
    }


    public void onFinish() {
        log("Thanks for using.");
    }
	public boolean onHorizontalOrVertTile(RSTile tile){
    boolean bool = false;    
    if ( getMyPlayer().getLocation().getX() == tile.getX() || getMyPlayer().getLocation().getY() == tile.getY() ) {
        if ( calc.distanceTo(tile) == 1 ) {
            bool = true;
        } else
            bool = false;
    }
    return bool;
}
	public void drawModel(Graphics g, RSObject o, Color c, String s, Color tc)	{
		if(o != null) {
		Polygon[] model = o.getModel().getTriangles();
                Point point = calc.tileToScreen(o.getLocation());
		for(Polygon p : model)	{
			g.setColor(c);
			g.fillPolygon(p);
                        g.setColor(c.darker());
			g.drawPolygon(p);
		}

		g.setColor(tc);
		g.drawString(s, point.x - 75, point.y - 35);
		}
        }
		public RSObject getSecondNearest(final RSObject curRock, final int... ids) {
	return objects.getNearest(new Filter<RSObject>() {
		public boolean accept(RSObject o) {
			if(curRock.equals(o))
				return false;
			for (int id : ids)
				if (o.getID() == id)
					return true;
			return false;
		}
	});
}
	public class minegui extends javax.swing.JFrame {

    /** Creates new form minegui */
    public minegui() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jSlider1 = new javax.swing.JSlider();
        jLabel3 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jCheckBox1 = new javax.swing.JCheckBox();

        setTitle("Brian's WorldMinerPro");
        setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
        setResizable(false);

        jTree1.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
        javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("Miner");
        javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Banking");
        javax.swing.tree.DefaultMutableTreeNode treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("East Varrock [Iron]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("South Varrock [Iron]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Iron]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Rimmington [Iron]");
        treeNode2.add(treeNode3);
		treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Rimmington [Copper]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Lumbridge Swamp [Coal]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Lumbridge Swamp [Coal, Mithril]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Barbarian Village [Coal, Mithril]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Mining Guild [Coal]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Mining Guild [Coal, Mithril]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Mithril]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Silver]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Adamant]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Copper]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Coal]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Tin]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Gold]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Crafting Guild [Coming Soon!]");
        treeNode1.add(treeNode2);
        treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Powermining");
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("East Varrock [Iron]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("South Varrock [Iron]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Iron]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Mithril]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Silver]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Adamant]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Copper]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Coal]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Tin]");
		treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Al Kharid [Gold]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Rimmington [Iron]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Lumbridge Swamp [Coal]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Barbarian Village [Coal]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Mining Guild [Coal]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Mining Guild [Coal, Mithril]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Crafting Guild [Gold]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Crafting Guild [Silver]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Crafting Guild [Clay]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Rimmington [Clay]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Rimmington [Copper]");
        treeNode2.add(treeNode3);
        treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Lumbridge Swamp [Copper]");
        treeNode2.add(treeNode3);
        treeNode1.add(treeNode2);
        jTree1.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        jTree1.setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
        jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTree1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTree1);

        jLabel1.setFont(new java.awt.Font("Comic Sans MS", 1, 12)); // NOI18N
        jLabel1.setText("Location");

        jButton1.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
        jButton1.setText("Run");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jSlider1.setMaximum(7);
        jSlider1.setMinimum(1);
        jSlider1.setPaintTicks(true);

        jLabel3.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
        jLabel3.setText("Mouse Speed");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Red & Black", "None" }));

        jLabel4.setFont(new java.awt.Font("Comic Sans MS", 0, 11)); // NOI18N
        jLabel4.setText("Paint");

        jCheckBox1.setText("Rest");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 129, Short.MAX_VALUE)
                                        .addComponent(jCheckBox1))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(57, 57, 57)
                                        .addComponent(jLabel4)))
                                .addGap(18, 18, 18)
                                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(12, 12, 12))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE)))
                        .addGap(0, 0, 0))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3)
                        .addGap(192, 192, 192))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 354, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCheckBox1)
                    .addComponent(jButton1)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(302, 302, 302)
                .addComponent(jLabel4)
                .addContainerGap(35, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>

    private void jTree1MouseClicked(java.awt.event.MouseEvent evt) {
		try {
        jLabel1.setText(jTree1.getLastSelectedPathComponent().toString());
        if(jTree1.getLastSelectedPathComponent().toString().contains("Lumbridge Swamp [Copper]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i56.tinypic.com/2ilejbp.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
        if(jTree1.getLastSelectedPathComponent().toString().contains("Lumbridge Swamp [Coal]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i53.tinypic.com/2v8fkft.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
        if(jTree1.getLastSelectedPathComponent().toString().contains("Lumbridge Swamp [Coal, Mithril]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i53.tinypic.com/2v8fkft.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
        if(jTree1.getLastSelectedPathComponent().toString().contains("East Varrock [Iron]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i54.tinypic.com/ak7803.jpg")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
                if(jTree1.getLastSelectedPathComponent().toString().contains("South Varrock [Iron]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i51.tinypic.com/o7uk5e.jpg")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
                        if(jTree1.getLastSelectedPathComponent().toString().contains("Crafting Guild [Gold]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i55.tinypic.com/6pt5w1.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
        if(jTree1.getLastSelectedPathComponent().toString().contains("Crafting Guild [Silver]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i56.tinypic.com/oacdj5.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
                if(jTree1.getLastSelectedPathComponent().toString().contains("Crafting Guild [Clay]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i51.tinypic.com/sw4nl4.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
                        if(jTree1.getLastSelectedPathComponent().toString().contains("Rimmington [Iron]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i56.tinypic.com/hvqovm.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
       if(jTree1.getLastSelectedPathComponent().toString().contains("Rimmington [Clay]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i54.tinypic.com/jkgd5k.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
               if(jTree1.getLastSelectedPathComponent().toString().contains("Rimmington [Copper]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i51.tinypic.com/qya36b.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
                       if(jTree1.getLastSelectedPathComponent().toString().contains("Mining Guild [Coal]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i56.tinypic.com/xf0wlw.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
       if(jTree1.getLastSelectedPathComponent().toString().contains("Mining Guild [Coal, Mithril]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i56.tinypic.com/xf0wlw.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
        
           if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Iron]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i53.tinypic.com/97l5bm.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
        if(jTree1.getLastSelectedPathComponent().toString().contains("Barbarian Village [Coal]")) {
        jLabel2.setIcon(new javax.swing.JLabel() {
            @Override
            public javax.swing.Icon getIcon() {
                
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("http://i51.tinypic.com/2guxxmf.png")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
       }
    } catch (NullPointerException e) {
	
	}
    }

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        MouseSpeed = jSlider1.getValue();
		if(jTree1.getLastSelectedPathComponent().toString().contains("Barbarian Village [Coal]")) {
		RSTile[] path = { new RSTile(3081, 3421), new RSTile(3090,3420), new RSTile(3098,3421), new RSTile(3104,3421), new RSTile(3106,3421), new RSTile(3119,3419), new RSTile(3120,3417),new RSTile(3130, 3417), new RSTile(3140,3418), new RSTile(3148,3418), new RSTile(3155,3419), new RSTile(3162,3423), new RSTile(3164,3424), new RSTile(3172,3429), new RSTile(3175,3429), new RSTile(3179,3430), new RSTile(3183,3429), new RSTile(3186,3430), new RSTile(3186,3433), new RSTile(3187,3435) };
		RSTile bank = new RSTile(3187,3435);
		RSTile mine = new RSTile(3081, 3421);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11932, 11930, 11931, 5770, 5771, 5772};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Lumbridge Swamp [Coal]")) {
		RSTile[] path = { new RSTile(3146,3150), new RSTile(3145,3156), new RSTile(3146,3158), new RSTile(3145,3160), new RSTile(3145,3161), new RSTile(3144,3163), new RSTile(3145,3164), new RSTile(3144,3167), new RSTile(3144,3168), new RSTile(3143,3169), new RSTile(3144,3171), new RSTile(3143,3173), new RSTile(3143,3174), new RSTile(3143,3175), new RSTile(3142,3177), new RSTile(3142,3179), new RSTile(3142,3180), new RSTile(3142,3181), new RSTile(3142,3182), new RSTile(3143,3184), new RSTile(3142,3186), new RSTile(3142,3187), new RSTile(3142,3189), new RSTile(3142,3191), new RSTile(3141,3194), new RSTile(3141,3195), new RSTile(3140,3196), new RSTile(3140,3199), new RSTile(3140,3201), new RSTile(3139,3202), new RSTile(3139,3203), new RSTile(3139,3204), new RSTile(3138,3206), new RSTile(3136,3205), new RSTile(3135,3206), new RSTile(3131,3206), new RSTile(3128,3207), new RSTile(3122, 3210), new RSTile(3125,3208), new RSTile(3123,3209), new RSTile(3122,3209), new RSTile(3122,3211), new RSTile(3120,3213), new RSTile(3120,3214), new RSTile(3119,3214), new RSTile(3118,3216), new RSTile(3117,3217), new RSTile(3117,3219), new RSTile(3115,3220), new RSTile(3114,3222), new RSTile(3113,3222), new RSTile(3112,3224), new RSTile(3111,3224), new RSTile(3110,3225), new RSTile(3111,3227), new RSTile(3110,3227), new RSTile(3110,3229), new RSTile(3110,3230), new RSTile(3110,3232), new RSTile(3109,3233), new RSTile(3106,3237), new RSTile(3105,3238), new RSTile(3104,3240), new RSTile(3103,3241), new RSTile(3103,3243), new RSTile(3101,3244), new RSTile(3100,3245), new RSTile(3099,3245), new RSTile(3097,3247), new RSTile(3094,3247), new RSTile(3092, 3248), new RSTile(3092,3244) };
		RSTile bank = new RSTile(3092,3244);
		RSTile mine = new RSTile(3146,3150);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11932, 11930, 11931, 5770, 5771, 5772};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Lumbridge Swamp [Coal, Mithril]")) {
		RSTile[] path = { new RSTile(3146,3150), new RSTile(3145,3156), new RSTile(3146,3158), new RSTile(3145,3160), new RSTile(3145,3161), new RSTile(3144,3163), new RSTile(3145,3164), new RSTile(3144,3167), new RSTile(3144,3168), new RSTile(3143,3169), new RSTile(3144,3171), new RSTile(3143,3173), new RSTile(3143,3174), new RSTile(3143,3175), new RSTile(3142,3177), new RSTile(3142,3179), new RSTile(3142,3180), new RSTile(3142,3181), new RSTile(3142,3182), new RSTile(3143,3184), new RSTile(3142,3186), new RSTile(3142,3187), new RSTile(3142,3189), new RSTile(3142,3191), new RSTile(3141,3194), new RSTile(3141,3195), new RSTile(3140,3196), new RSTile(3140,3199), new RSTile(3140,3201), new RSTile(3139,3202), new RSTile(3139,3203), new RSTile(3139,3204), new RSTile(3138,3206), new RSTile(3136,3205), new RSTile(3135,3206), new RSTile(3131,3206), new RSTile(3128,3207), new RSTile(3122, 3210), new RSTile(3125,3208), new RSTile(3123,3209), new RSTile(3122,3209), new RSTile(3122,3211), new RSTile(3120,3213), new RSTile(3120,3214), new RSTile(3119,3214), new RSTile(3118,3216), new RSTile(3117,3217), new RSTile(3117,3219), new RSTile(3115,3220), new RSTile(3114,3222), new RSTile(3113,3222), new RSTile(3112,3224), new RSTile(3111,3224), new RSTile(3110,3225), new RSTile(3111,3227), new RSTile(3110,3227), new RSTile(3110,3229), new RSTile(3110,3230), new RSTile(3110,3232), new RSTile(3109,3233), new RSTile(3106,3237), new RSTile(3105,3238), new RSTile(3104,3240), new RSTile(3103,3241), new RSTile(3103,3243), new RSTile(3101,3244), new RSTile(3100,3245), new RSTile(3099,3245), new RSTile(3097,3247), new RSTile(3094,3247), new RSTile(3092, 3248), new RSTile(3092,3244) };
		RSTile bank = new RSTile(3092,3244);
		RSTile mine = new RSTile(3146,3150);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11932, 11930, 11931, 5770, 5771, 5772};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Iron]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {37309, 37307, 37308};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("South Varrock [Iron]")) {
		RSTile[] path = { new RSTile(3287,3370), new RSTile(3291, 3375), new RSTile(3293,3374), new RSTile(3292,3376), new RSTile(3294,3382), new RSTile(3291,3394), new RSTile(3291,3406), new RSTile(3287,3419), new RSTile(3278,3429), new RSTile(3268,3429), new RSTile (3258,3429), new RSTile(3253,3420) };
		RSTile bank = new RSTile(3253, 3420);
		RSTile mine = new RSTile(3287,3370);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {9719, 9718, 9717, 11954, 11955, 11956, 37307, 37308, 37309};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("West Varrock [Iron]")) {
		RSTile[] path = { new RSTile(3175, 3367), new RSTile(3172, 3372), new RSTile(3173, 3381), new RSTile(3172, 3387), new RSTile(3172, 3394), new RSTile(3170, 3403), new RSTile(3170, 3413), new RSTile(3170, 3421), new RSTile (3176, 3428), new RSTile(3183, 3430), new RSTile(3187, 3436) };
		RSTile bank = new RSTile(3187, 3436);
		RSTile mine = new RSTile(3175,3367);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {9719, 9718, 9717, 11954, 11955, 11956, 37307, 37308, 37309};
		Rocks = mineRock;
		}
		if(jTree1.getSelectionPath().toString().contains("Powermining")) {
		PowerMine = true;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Rimmington [Iron]")) {
		RSTile[] path = { new RSTile(2968, 3240), new RSTile(2970, 3244), new RSTile(2974, 3248), new RSTile(2977, 3254), new RSTile(2981, 3260), new RSTile(2985, 3266), new RSTile(2990, 3273), new RSTile(2999, 3278), new RSTile(3004, 3285), new RSTile(3006, 3293), new RSTile(3005, 3300), new RSTile(3005, 3308), new RSTile(3006, 3314), new RSTile(3006, 3322), new RSTile(3006, 3330), new RSTile(3006, 3335),new RSTile(3007,3340), new RSTile(3007, 3344), new RSTile(3007, 3348), new RSTile(3006, 3351), new RSTile(3005, 3354), new RSTile(3006, 3357), new RSTile(3007, 3360), new RSTile(3010, 3360), new RSTile(3012, 3359), new RSTile(3012, 3355) };
		RSTile bank = new RSTile(3012, 3355);
		RSTile mine = new RSTile(2968,3240);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {9719, 9718, 9717, 11954, 11955, 11956, 37307, 37308, 37309};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Rimmington [Copper]")) {
		RSTile[] path = { new RSTile(2968, 3240), new RSTile(2970, 3244), new RSTile(2974, 3248), new RSTile(2977, 3254), new RSTile(2981, 3260), new RSTile(2985, 3266), new RSTile(2990, 3273), new RSTile(2999, 3278), new RSTile(3004, 3285), new RSTile(3006, 3293), new RSTile(3005, 3300), new RSTile(3005, 3308), new RSTile(3006, 3314), new RSTile(3006, 3322), new RSTile(3006, 3330), new RSTile(3006, 3335),new RSTile(3007,3340), new RSTile(3007, 3344), new RSTile(3007, 3348), new RSTile(3006, 3351), new RSTile(3005, 3354), new RSTile(3006, 3357), new RSTile(3007, 3360), new RSTile(3010, 3360), new RSTile(3012, 3359), new RSTile(3012, 3355) };
		RSTile bank = new RSTile(3012, 3355);
		RSTile mine = new RSTile(2977,3248);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {9708, 9709, 9710, 11937, 19936, 11938};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Rimmington [Clay]")) {
		int[] mineRock = {11189, 11190, 11191, 9711, 9713};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Crafting Guild [Clay]")) {
		int[] mineRock = {11189, 11190, 11191, 9711, 9713};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Crafting Guild [Gold]")) {
		int[] mineRock = {11183, 11184, 11185};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Crafting Guild [Silver]")) {
		int[] mineRock = {11186, 11187, 11188};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Lumbridge Swamp [Copper]")) {
		int[] mineRock = {9708, 9709, 9710, 11937, 19936, 11938};
		Rocks = mineRock;
		}
		if(jTree1.getSelectionPath().toString().contains("Powermining")) {
		PowerMine = true;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Mining Guild [Coal]")) {
		RSTile[] path = { new RSTile(3045, 9748), new RSTile(3045, 9741),new RSTile(3041, 9738), new RSTile(3035, 9738),  new RSTile(3029, 9738), new RSTile(3024, 9739), new RSTile(3021, 9739), new RSTile(3021, 3339), new RSTile(3028, 3336), new RSTile(3029, 3342), new RSTile(3028, 3346), new RSTile(3025, 3349), new RSTile(3022, 3353), new RSTile(3019, 3358), new RSTile(3015, 3360), new RSTile(3013, 3355) };
		RSTile bank = new RSTile(3013,3355);
		RSTile mine = new RSTile(3045,9748);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11932, 11930, 11931, 5770, 5771, 5772};
		Rocks = mineRock;
		MineGuild = true;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Mining Guild [Coal, Mithril]")) {
		RSTile[] path = { new RSTile(3045, 9748), new RSTile(3045, 9741),new RSTile(3041, 9738), new RSTile(3035, 9738),  new RSTile(3029, 9738), new RSTile(3024, 9739), new RSTile(3021, 9739), new RSTile(3021, 3339), new RSTile(3028, 3336), new RSTile(3029, 3342), new RSTile(3028, 3346), new RSTile(3025, 3349), new RSTile(3022, 3353), new RSTile(3019, 3358), new RSTile(3015, 3360), new RSTile(3013, 3355) };
		RSTile bank = new RSTile(3013,3355);
		RSTile mine = new RSTile(3045,9748);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11932, 11930, 11931, 5786, 5785, 5784, 5770, 5771, 5772};
		Rocks = mineRock;
		MineGuild = true;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Wilderness Goblins [Coal]")) {
		RSTile[] path = { new RSTile(3096,3494), new RSTile(3088,3493), new RSTile(3088,3495), new RSTile(3088,3496), new RSTile(3087,3499), new RSTile(3087,3500), new RSTile(3088,3502), new RSTile(3088,3503), new RSTile(3088,3504), new RSTile(3088,3505), new RSTile(3088,3507), new RSTile(3087,3508), new RSTile(3088,3509), new RSTile(3087,3510), new RSTile(3087,3512), new RSTile(3088,3513), new RSTile(3088,3515), new RSTile(3087,3517), new RSTile(3087,3519), new RSTile(3087,3521), new RSTile(3087,3524), new RSTile(3086,3526), new RSTile(3085,3528), new RSTile(3084,3530), new RSTile(3083,3532), new RSTile(3082,3534), new RSTile(3081,3536), new RSTile(3080,3538), new RSTile(3078,3541), new RSTile(3074,3545), new RSTile(3071,3548), new RSTile(3071,3550), new RSTile(3069,3551), new RSTile(3068,3553), new RSTile(3066,3556), new RSTile(3064,3559), new RSTile(3062,3560), new RSTile(3060,3562), new RSTile(3058,3564), new RSTile(3056,3566), new RSTile(3053,3568), new RSTile(3051,3570), new RSTile(3049,3572), new RSTile(3046,3574), new RSTile(3044,3576), new RSTile(3041,3577), new RSTile(3040,3579), new RSTile(3038,3580), new RSTile(3037,3581), new RSTile(3035,3583), new RSTile(3032,3585), new RSTile(3030,3586), new RSTile(3027,3587), new RSTile(3025,3588), new RSTile(3024,3590), new RSTile(3022,3592), new RSTile(3020,3593), new RSTile(3019,3593) };
		RSTile bank = new RSTile(3096,3494);
		RSTile mine = new RSTile(3019,3593);
		BankTile = bank;
		MineTile = mine;
		toBank = walking.reversePath(path);
		toMine = path;
		int[] mineRock = {11932, 11930, 11931, 5770, 5771, 5772};
		Rocks = mineRock;
		wildi = true;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Copper]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11936, 11937, 11938};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Mithril]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11942, 11944};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Silver]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {37304, 37306, 37305, 2311};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Adamant]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11939, 11941};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Coal]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11932, 11930};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Tin]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {11933};
		Rocks = mineRock;
		}
		if(jTree1.getLastSelectedPathComponent().toString().contains("Al Kharid [Gold]")) {
		RSTile[] path = { new RSTile(3301,3310), new RSTile(3298, 3301), new RSTile(3298, 3292), new RSTile(3297, 3280), new RSTile(3294, 3273), new RSTile(3294, 3259), new RSTile(3293, 3247), new RSTile(3290, 3235), new RSTile(3282, 3228), new RSTile(3282, 3215), new RSTile(3284, 3199), new RSTile(3281, 3187), new RSTile(3277, 3174), new RSTile(3274, 3167), new RSTile(3269, 3167) };
		RSTile bank = new RSTile(3269, 3167);
		RSTile mine = new RSTile(3301,3310);
		BankTile = bank;
		MineTile = mine;
		toBank = path;
		toMine = walking.reversePath(path);
		int[] mineRock = {37312, 37310};
		Rocks = mineRock;
		}
		if(jTree1.getSelectionPath().toString().contains("Powermining")) {
		PowerMine = true;
		}
		if(jComboBox1.getSelectedItem().toString().contains("None")) {
		paint = false;
		}
		if(jCheckBox1.isSelected()) {
        rest = true;
        }
        setVisible(false);
		Start = true;
		Settings = true;
    }
	

    

    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSlider jSlider1;
    private javax.swing.JTree jTree1;
    // End of variables declaration

}
}

